<template>
  <div>
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>待审核项目
          </p>
        </div>
        <div class="topright">
          <!--<el-button type="info" @click="$router.go(-1)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe606;</span>返回
          </el-button>-->
          <el-button type="info" @click="$router.go(0)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe662;</span>刷新
          </el-button>
        </div>
      </div>
    </div>

    <div class="table">
      <el-table ref="multipleTable" :data="info" tooltip-effect="dark" style="width:100%" border>
        <el-table-column label="时间" align="center" width="150">
          <template slot-scope="scope">{{scope.row.auditStartTime | dateFilter}}</template>
        </el-table-column>
        <el-table-column label="项目编号" align="center" width="245" prop="proNo"></el-table-column>
        <el-table-column label="项目名称" align="center" width="245" prop="proName"></el-table-column>
        <el-table-column label="项目状态" align="center" width="245" prop="auditStatus"></el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <a
              class="options"
              @click.prevent="$router.push({name:'examine',query:{proId:scope.row.proId}})"
            >工作量统计</a>
            <a
              class="options"
              @click="handleSubInfo({proId:scope.row.proId,flowStep:scope.row.nextFlowStep})"
            >同意</a>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <!-- <div class="component-model">
      <el-dialog :title="Title" :visible.sync="modelInfo.Visible" width="600px">
      <span>审核意见：</span>
      <el-radio v-model="modelInfo.radio" label="1">同意</el-radio>
      <el-radio v-model="modelInfo.radio" label="0">驳回</el-radio>
      <div style="margin-top:20px;">
      <span style="vertical-align:top;margin-left:40px;">备注：</span>
      <el-input type="textarea" v-model="modelInfo.desc" style="width:180px;resize:none;"></el-input>
      </div>

        <span slot="footer" class="dialog-footer">
          <el-button @click="modelInfo.Visible = false">取消</el-button>
          <el-button @click="subIdea">确定</el-button>
        </span>
      </el-dialog>
    </div>-->
  </div>
</template>

<script>
export default {
  name: "unProject",
  data() {
    return {
      Title: "审核意见",
      info: [],
      modelInfo: {
        Visible: false,
        radio: "1",
        desc: "",
        proId: ""
      }
    };
  },
  created() {
    this.dataInit();
  },
  mounted() {},
  methods: {
    dataInit() {
      let that = this,
        suCb = res => {
          console.log("待验收项目查询结果：", res);
          that.info = that.deepClone(res.data.data);
        },
        erCb = res => {
          
        },
        params = {
          pageCurrent: 1,
          pageSize: 500,
          progress: [6]
        },
        req = {
          url: "/api/web/proProject/queryAuditTaskList",
          methods: "post",
          data: "",
          success: suCb,
          error: erCb
        };
      that.$https(req);
    },
    // ideaModel(id) {
    //   this.modelInfo.Visible = true;
    //   this.modelInfo.proId = id;
    // },
    // 提交上级审核
    handleSubInfo(info) {
      let that = this,
        suCb = res => {
          console.log("提交结果结果", res);
          if (res.data.flag == 1) {
            that.$msg("提交成功");
            that.dataInit()
          }
        },
        erCb = res => {
          
          console.log(res);
        },
        req = {
          url: "/api/web/proProject/AuditWorkLoadDetail",
          methods: "post",
          data: info,
          success: suCb,
          error: erCb
        };
      console.log("提交参数", req.data);
      that.$https(req);
    }
  },
  watch: {}
};
</script>
<style scoped>
.table {
  width: 1100px;
  margin: 20px auto;
}
a {
  cursor: pointer;
  color: #1abc9c;
  text-decoration: none;
}
</style>
